<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>扩展运算符和剩余函数</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
    </div>

    <script>
        const nums1=[1,2,3];
        const nums2=[4,5,6];
        const combined=[...nums1,...nums2];
        console.log(combined);

        function sum(a,b,c){
            return a+b+c;
        }
        const numbers=[1,2,3];
        console.log(sum(...numbers));

        const obj1={a:1,b:2};
        const obj2={b:3,c:4};
        const combinedObj={...obj1,...obj2};
        console.log(combinedObj);

        function concatenate(separator,...strings){
            return strings.join(separator);
        }
        console.log(concatenate("-","Vue","React","Angular"));
    </script>
</body>
</html>
